//
//  CocoaLocation.h
//  打工宝
//
//  Created by 中昊科技 on 15/6/3.
//  Copyright (c) 2015年 中昊科技. All rights reserved.
//

//#warning plist文件中添加
/*
 * NSLocationAlwaysUsageDescription String 应用程序始终使用定位服务
 * NSLocationWhenInUseUsageDescription String 使用应用程序期间，可以使用定位服务
 */

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
#import <CoreLocation/CoreLocation.h>

typedef void (^LocationBlock)(CLLocation * location,CLPlacemark * placemark,NSError *error);

typedef void(^LocationDetail)(CLLocation * location,CLPlacemark * placemark,NSDictionary *adressDic);

@interface ZYLocationManager : NSObject<CLLocationManagerDelegate,MKMapViewDelegate>

@property (nonatomic,strong)CLLocationManager *locationManager;
@property (nonatomic,strong) MKMapView *mapView;
@property (nonatomic, strong) CLPlacemark * placeMark;
@property (nonatomic, strong) NSDictionary *addressDic;
@property (nonatomic, strong) LocationBlock locationBlock;
@property (nonatomic, strong) LocationDetail dataBlock;


/**
 * isAlwaysUse  是否后台定位 持续定位（NSLocationAlwaysUsageDescription）
 */
@property (nonatomic, assign) BOOL isAlwaysUse;
/**
 * isRealTime 是否实时定位
 */
@property (nonatomic, assign) BOOL isRealTime;
/**
 * 精度 默认 kCLLocationAccuracyKilometer
 */
@property (nonatomic, assign) CGFloat desiredAccuracy;
/**
 * 更新距离 (默认)任何的移动
 */
@property (nonatomic, assign) CGFloat distanceFilter;





+ (ZYLocationManager *)shareLocation;
/**
 *  停止定位
 */
-(void)stopLocation;
/**
 * （推荐使用）定位得到坐标和详细信息
 */
-(void)getLoctionManager:(LocationBlock)loctionBlock;

/**
 *  地图获取坐标和详细信息
 *
 *  @param locaiontBlock locaiontBlock description
 */
- (void) getMapLocationCoordinate:(LocationBlock) locaiontBlock ;

/**
 *  获取坐标和地址 城市 等相信信息
 *
 */
- (void) getMapLocationDatil:(LocationDetail) locaiontBlock;


/**
 *  反地理编码/
 *   参考：/http://blog.csdn.net/lvxiangan/article/details/26015147
 *  @param locon     经纬度
 *  @param dataBlock 返回具体信息
 */
-(void)geocodeLocation:(CLLocationCoordinate2D)locon andLocaiontBlock:(void(^)(NSDictionary *data, NSError *error))dataBlock;


@end
